package filterCalc;

import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * Abstract filter class, used to make a filtercalculator.
 * Includes a plotter at standard that can be moved anc changed if required.
 * set up user interface as needed whitin 640 by 480 pixles that the panel is set to.
 * Name of filter is shown by the FilterClac class, so no spaces is needed to show this.
 * 
 * @author Sletten
 *
 */

@SuppressWarnings("serial")
public abstract class Filter extends JPanel
{
	protected JLabel mNameLabel;
	protected String mShortName; // Name to be shown in list
	
	protected Plotter mPlotter;

	Filter()
	{
		mShortName = "Filter";
		
		this.setPreferredSize(new Dimension(640, 480));
		this.setLayout(null);
		this.setBounds(150, 110, 640, 480);
		this.setBackground(Color.LIGHT_GRAY);
		
		mNameLabel = new JLabel("Filter");
		
		mPlotter = new Plotter();
		mPlotter.setActiveFilter(this);
		mPlotter.setRange(1, 10000, 0, 40);
		mPlotter.setBounds(0, 240, 640, 240);
		this.add(mPlotter);
	}

	public String getFilterName(){return mNameLabel.getText();}
	public void setFilterName(String inName){mNameLabel.setText(inName);}
	public String toString(){return mShortName;}
	
	abstract protected double calcHfAmp(double inF);
	
	
}




